<template>

  <el-menu
    :default-active="this.$route.path"
    class="categories"
    style="padding-top:50px"
    default-active="1"
    @select="handleSelect"
    active-text-color="red"
    router>
    <el-menu-item index="/addLesson">
      <i class="el-icon-menu"></i>
      <span slot="title"> 创建课程 </span>
    </el-menu-item>

    <el-menu-item index="/teacherlesson">
      <i class="el-icon-menu"></i>
      <span slot="title"> 我的课程 </span>
    </el-menu-item>

    <el-menu-item index="/teacherlesson" @click="this.setStatus1">
      <i class="el-icon-arrow-right"></i>
      课程状态1</el-menu-item>
    <el-menu-item index="/teacherlesson" @click="this.setStatus2">
      <i class="el-icon-arrow-right"></i>
      课程状态2</el-menu-item>
    <el-menu-item index="/teacherlesson" @click="this.setStatus3">
      <i class="el-icon-arrow-right"></i>
      课程状态3</el-menu-item>
  </el-menu>

</template>

<script>
    export default {
        name: 'SideMenu',
        methods:{
            setStatus1() {
                if(window.sessionStorage.getItem('lessonstatus')!='1')
                {
                    window.sessionStorage.setItem('lessonstatus', 1)
                    location.reload()
                }
            },
            setStatus2() {
                // var _this = this;
                if(window.sessionStorage.getItem('lessonstatus')!='2')
                {
                window.sessionStorage.setItem('lessonstatus', 2)
                location.reload()
                }
                    // _this.$message.error("请填写正确验证码");
                // console.log( window.sessionStorage.getItem('lessonstatus') )
            },
            setStatus3() {
                if(window.sessionStorage.getItem('lessonstatus')!='3')
                {
                window.sessionStorage.setItem('lessonstatus', 3)
                location.reload()
                }
            }
        }
    }

</script>

<style scoped>
  .categories {
    float: left;
    top: 20px;
    width: 150px;
    margin-left: 10px;
  }
</style>
